package com.bowos.zmado.web;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.bowos.utils.RenderUtils;
import com.bowos.zmado.dao.UserDao;

@Controller
public class HelloWorldController {
	@Autowired
	public UserDao userDao;
	
	
	@RequestMapping(value = "/helloWorld", method = RequestMethod.GET)
	public void helloWorld(Model model, HttpServletResponse response, HttpServletRequest request) {
		model.addAttribute("message", "Hello World!");
		
		System.out.println(userDao.getUserById(131).getUsername());
		
		RenderUtils.renderText(response, "hello");
	}
}
